/* GUI CONVERTED from rwariq.p (converter v1.75) Sat Aug 12 23:17:05 2000 */
/* rwariq.p - ALTERNATE ROUTING INQUIRY                                 */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rwariq.p (converter v1.00) Fri Oct 10 13:58:01 1997 */
/* web tag in rwariq.p (converter v1.00) Mon Oct 06 14:18:41 1997 */
/*F0PN*/ /*K1K6*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 6.0     LAST EDIT: 02/22/91   MODIFIED BY: emb *D342* */
/* REVISION: 7.0     LAST EDIT: 04/29/92   MODIFIED BY: emb *F457* */
/* Revision: 7.3    Last edit: 11/19/92     By: jcd *G339* */
/* Revision: 7.3    Last edit: 08/28/94     By: srk *GL73* */
/* Revision: 8.6    Last edit: 02/27/98  By: *K1K6* Beena Mol      */
/* Revision: 8.6    Last edit: 05/20/98  By: *K1Q4* Alfred Tan          */
/* Revision: 8.6    Last edit: 06/03/98  By: *K1RW* A.Shobha            */
/* REVISION: 9.1    LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */

/*K1K6*/   /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1K6*/   {mfdtitle.i "b+ "}

          define variable desc2 like pt_desc2.
          define variable site_default as character format "x(1)".

/*K1K6*   /* DISPLAY TITLE */
 *         {mfdtitle.i "b+ "} */

          
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
/*GL73*/     space(1)
             ptr_part pt_desc1 no-label ptr_site
          with frame a no-underline width 80 attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



          /* SET EXTERNAL LABELS */
          setFrameLabels(frame a:handle).

/*K1K6*/ {wbrp01.i}

repeat:

/*K1K6*/ if c-application-mode <> 'web' then

   prompt-for
   ptr_part validate (true,"")
   ptr_site
   with frame a editing:

      if frame-field = "ptr_part" then do:

     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp.i ptr_det ptr_part ptr_part ptr_part ptr_part ptr_part}

     if recno <> ? then do with frame a:
        display ptr_part.
        find pt_mstr no-lock where pt_part = ptr_part no-error.
        if available pt_mstr then display pt_desc1.
        else display " " @ pt_desc1.
     end.
     recno = ?.
      end.
      else if frame-field = "ptr_site" then do:

     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp05.i ptr_det ptr_part "ptr_part = input ptr_part"
      ptr_site "input ptr_site"}

     if recno <> ? then do with frame a:
        display ptr_site.
     end.
     recno = ?.
      end.
      else do:
     status input.
     readkey.
     apply lastkey.
      end.
   end.

/*K1K6*/ {wbrp06.i &command = prompt-for &fields =
          " ptr_part validate ( true ,'') ptr_site" &frm = "a"}

/*K1K6*/ if (c-application-mode <> 'web') or
/*K1K6*/ (c-application-mode = 'web' and
/*K1K6*/ (c-web-request begins 'data')) then do:

   if input ptr_part > "" then do with frame a:
      find pt_mstr no-lock where pt_part = input ptr_part no-error.
      if available pt_mstr then display pt_desc1.
      else display " " @ pt_desc1.
   end.
   else display " " @ pt_desc1 with frame a.

   status input.

   hide frame b.
   hide frame c.

/*K1K6*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 80}

   if input ptr_part > "" then
   for each ptr_det no-lock using ptr_part
   where (ptr_site = input ptr_site or input ptr_site = "")
   with frame b width 80 no-attr-space down:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame b:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/

      find ptp_det no-lock where ptp_part = ptr_part
      and ptp_site = ptr_site
      and ptp_routing = ptr_routing
/*F457*  and ptp_bom_code = ptr_user1 no-error. */
/*F457*/ and ptp_bom_code = ptr_bom_code no-error.
      if available ptp_det then site_default = "*".
      else site_default = "".

      display ptr_site site_default no-label
      ptr_routing
/*F457*  ptr_user1 @ ptp_bom_code. */
/*F457*/ ptr_bom_code @ ptp_bom_code WITH STREAM-IO /*GUI*/ .

   end.
   else
   for each ptr_det no-lock where
   ptr_site = input ptr_site or input ptr_site = ""
   break by ptr_part
   with frame c width 80 no-attr-space down:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame c:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
         /*G339*/

      find ptp_det no-lock where ptp_part = ptr_part
      and ptp_site = ptr_site
      and ptp_routing = ptr_routing
/*F457*  and ptp_bom_code = ptr_user1 no-error. */
/*F457*/ and ptp_bom_code = ptr_bom_code no-error.
      if available ptp_det then site_default = "*".
      else site_default = "".

      if first-of (ptr_part) then do with frame c:
     find pt_mstr no-lock where pt_part = ptr_part no-error.
     display pt_part format "x(27)" WITH STREAM-IO /*GUI*/ .
     down 1.
     display "   " + pt_desc1 @ pt_part
     ptr_site site_default no-label ptr_routing
/*F457*  ptr_user1 @ ptp_bom_code. */
/*F457*/ ptr_bom_code @ ptp_bom_code WITH STREAM-IO /*GUI*/ .
     desc2 = pt_desc2.
      end.
      else do with frame c:
     display "   " + desc2 @ pt_part
     ptr_site site_default no-label ptr_routing
/*F457*  ptr_user1 @ ptp_bom_code. */
/*F457*/ ptr_bom_code @ ptp_bom_code WITH STREAM-IO /*GUI*/ .
     desc2 = "".
      end.
      if last-of (ptr_part) and desc2 > "" then do with frame c:
     down 1.
     display "   " + desc2 @ pt_part WITH STREAM-IO /*GUI*/ .
     desc2 = "".
      end.
   end.

   {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

   {mfmsg.i 8 1}
end.

/*K1K6*/ {wbrp04.i &frame-spec = a}
